package org.tbjd.client.dndControllers.projectSwitcher;

import org.tbjd.client.images.projectSwitcher.dnd.DndImageBundle;

import com.allen_sauer.gwt.dnd.client.DragContext;
import com.allen_sauer.gwt.dnd.client.PickupDragController;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

public class GridRowPickupDragController extends PickupDragController {

	private DndImageBundle dndImageBundle = (DndImageBundle) GWT.create(DndImageBundle.class);

	public GridRowPickupDragController(AbsolutePanel boundaryPanel) {
		super(boundaryPanel, false);
		setBehaviorDragProxy(true);
		setBehaviorMultipleSelection(true);
	}

	protected Widget newDragProxy(DragContext context) {
		AbsolutePanel proxy = new AbsolutePanel();
		proxy.setSize("50px", "50px");
		proxy.add(dndImageBundle.redBorderdCircle_15x15().createImage(), 29, 9);
		proxy.add(new Label(String.valueOf(context.selectedWidgets.size())), 33, 9);

		return proxy;
	}

}